#ifndef KEYWORDSEARCH_H
#define KEYWORDSEARCH_H

#include "include/search.h"
#include "include/searchItem.h"
class QWSInputMethod;

class QPushButton;
class QLineEdit;

class KeyWordSearchDlg : public Search
{
    Q_OBJECT

public:
    KeyWordSearchDlg(QWidget *parent = 0);

signals:
    void sendItemId(QString itemId);

protected slots:
    void SearchItems();

private:
    QString BuildQuery();
    QString obtainStr();
    QStringList obtainAreaList(QString areaStr);
    QStringList obtainRidgepoleList(QString areaStr);
    QStringList obtainLayerList(QString areaStr);
    QStringList obtainRoomList(QString areaStr);
    QStringList obtainDevNameList(QString areaStr);
    QWSInputMethod* im;

    void CreateWidget();
    void CreateLayout();
    void UpdateSearchResult(const QString &sqlQuery);
    void timerEvent(QTimerEvent *);
    void showEvent(QShowEvent *);

    int myTimerId;

    QString searchStr;

    QPushButton *searchBtn;
    QPushButton *quit;
    QLineEdit *searchLineEdit;

    SearchItem *item[NUM_OF_TOTAL_ITEM];
};

#endif // KEYWORDSEARCH_H
